<?php
include("./include/om_config.inc");

if(isset($_POST['userName']) && strlen($_POST['userName']) > 0 || isset($_POST['password']) && strlen($_POST['password']) > 0)
{
  $checkLogin = "SELECT userName,password
                   FROM login
                  WHERE userName = '".$_POST['userName']."'
                    AND password = '".$_POST['password']."'";
  $checkLoginresult = mysql_query($checkLogin);
  if($userLoginRow = mysql_fetch_array($checkLoginresult))
  {
    $_SESSION['s_activId']   = $userLoginRow['userName'];
    if(!$_SESSION['s_urlRedirectDir'])
      header("Location:./index.php");
    else
      header("Location:".$_SESSION['s_urlRedirectDir']);
  }
  else
    echo "Wrong ID of PWD";
}

include("./bottom.php");
$smarty->display("checkLogin.tpl");
?>